home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / include / DShowIDL / Vmrender.idl < prev   
Text File  |  2001-10-08  |  25KB  |  876 lines

  1. //------------------------------------------------------------------------------
  2. // File: Vmrender.idl
  3. //
  4. // Desc: Public Interfaces for the Video Mixing Renderer DShow filter
  5. //
  6. // Copyright (c) 1992-2001, Microsoft Corporation.  All rights reserved.
  7. //------------------------------------------------------------------------------
  8.  
  9. cpp_quote("#if 0")
  10. // This is a temporary workaround to persuade MIDL to allow
  11. // forward declarations
  12. typedef DWORD*    LPDIRECTDRAW7;
  13. typedef DWORD*    LPDIRECTDRAWSURFACE7;
  14. typedef DWORD*    LPDDPIXELFORMAT;
  15. typedef DWORD*    LPBITMAPINFOHEADER;
  16. typedef struct {DWORD dw1; DWORD dw2;} DDCOLORKEY;
  17. typedef DDCOLORKEY*    LPDDCOLORKEY;
  18.  
  19. cpp_quote ("#endif")
  20. cpp_quote("#include <ddraw.h>")
  21.  
  22.  
  23. // public interfaces supported by the VMR
  24. interface IVMRSurface;
  25.  
  26. interface IVMRSurfaceAllocator;
  27. interface IVMRSurfaceAllocatorNotify;
  28. interface IVMRImagePresenter;
  29. interface IVMRImagePresenterConfig;
  30.  
  31. interface IVMRWindowlessControl;
  32. interface IVMRMixerControl;
  33. interface IVMRMixerBitmap;
  34. interface IVMRFilterConfig;
  35. interface IVMRMonitorConfig;
  36.  
  37. interface IVMRImageCompositor;
  38.  
  39. interface IVMRVideoStreamControl;
  40.  
  41.  
  42.  
  43.  
  44. ///////////////////////////////////////////////////////////////////////////////
  45. //
  46. // Allocator Presenter interfaces
  47. //
  48. ///////////////////////////////////////////////////////////////////////////////
  49.  
  50.  
  51.  
  52. //=====================================================================
  53. //
  54. // IVMRImagePresenter
  55. //
  56. //=====================================================================
  57. typedef enum {
  58.     VMRSample_SyncPoint       = 0x00000001,
  59.     VMRSample_Preroll         = 0x00000002,
  60.     VMRSample_Discontinuity   = 0x00000004,
  61.     VMRSample_TimeValid       = 0x00000008,
  62. } VMRPresentationFlags;
  63.  
  64.  
  65. typedef struct tagVMRPRESENTATIONINFO {
  66.     DWORD                   dwFlags;
  67.     LPDIRECTDRAWSURFACE7    lpSurf;
  68.     REFERENCE_TIME          rtStart;
  69.     REFERENCE_TIME          rtEnd;
  70.     SIZE                    szAspectRatio;
  71.     RECT                    rcSrc;
  72.     RECT                    rcDst;
  73.     DWORD                   dwTypeSpecificFlags;
  74.     DWORD                   dwInterlaceFlags;
  75. } VMRPRESENTATIONINFO;
  76.  
  77. [
  78.     local,
  79.     object,
  80.     local,
  81.     uuid(CE704FE7-E71E-41fb-BAA2-C4403E1182F5),
  82.     helpstring("IVMRImagePresenter Interface"),
  83.     pointer_default(unique)
  84. ]
  85. interface IVMRImagePresenter : IUnknown
  86. {
  87.     HRESULT StartPresenting(
  88.         [in] DWORD_PTR dwUserID
  89.         );
  90.  
  91.     HRESULT StopPresenting(
  92.         [in] DWORD_PTR dwUserID
  93.         );
  94.  
  95.  
  96.     HRESULT PresentImage(
  97.         [in] DWORD_PTR dwUserID,
  98.         [in] VMRPRESENTATIONINFO* lpPresInfo
  99.         );
  100. };
  101.  
  102.  
  103. //=====================================================================
  104. //
  105. // IVMRSurfaceAllocator
  106. //
  107. //=====================================================================
  108.  
  109. typedef enum {
  110.     AMAP_PIXELFORMAT_VALID  = 0x01,
  111.     AMAP_3D_TARGET          = 0x02,
  112.     AMAP_ALLOW_SYSMEM       = 0x04,
  113.     AMAP_FORCE_SYSMEM       = 0x08,
  114.     AMAP_DIRECTED_FLIP      = 0x10,
  115.     AMAP_DXVA_TARGET        = 0x20
  116. } VMRSurfaceAllocationFlags;
  117.  
  118. typedef struct tagVMRALLOCATIONINFO {
  119.     DWORD                   dwFlags;
  120.     LPBITMAPINFOHEADER      lpHdr;
  121.     LPDDPIXELFORMAT         lpPixFmt;
  122.     SIZE                    szAspectRatio;
  123.     DWORD                   dwMinBuffers;
  124.     DWORD                   dwMaxBuffers;
  125.     DWORD                   dwInterlaceFlags;
  126.     SIZE                    szNativeSize;
  127. } VMRALLOCATIONINFO;
  128.  
  129. [
  130.     local,
  131.     object,
  132.     local,
  133.     uuid(31ce832e-4484-458b-8cca-f4d7e3db0b52),
  134.     helpstring("IVMRSurfaceAllocator Interface"),
  135.     pointer_default(unique)
  136. ]
  137. interface IVMRSurfaceAllocator : IUnknown
  138. {
  139.     HRESULT AllocateSurface(
  140.         [in] DWORD_PTR dwUserID,
  141.         [in] VMRALLOCATIONINFO* lpAllocInfo,
  142.         [in] [out] DWORD* lpdwActualBuffers,
  143.         [out] LPDIRECTDRAWSURFACE7 *lplpSurface
  144.         );
  145.  
  146.     HRESULT FreeSurface(
  147.         [in] DWORD_PTR dwID
  148.         );
  149.  
  150.     HRESULT PrepareSurface(
  151.         [in] DWORD_PTR dwUserID,
  152.         [in] LPDIRECTDRAWSURFACE7 lpSurface,
  153.         [in] DWORD dwSurfaceFlags
  154.         );
  155.  
  156.     HRESULT AdviseNotify(
  157.         [in] IVMRSurfaceAllocatorNotify* lpIVMRSurfAllocNotify
  158.         );
  159. };
  160.  
  161.  
  162. //=====================================================================
  163. //
  164. // IVMRSurfaceAllocatorNotify
  165. //
  166. //=====================================================================
  167. [
  168.     local,
  169.     object,
  170.     local,
  171.     uuid(aada05a8-5a4e-4729-af0b-cea27aed51e2),
  172.     helpstring("IVMRSurfaceAllocatorNotify Interface"),
  173.     pointer_default(unique)
  174. ]
  175. interface IVMRSurfaceAllocatorNotify : IUnknown
  176. {
  177.     HRESULT AdviseSurfaceAllocator(
  178.         [in] DWORD_PTR dwUserID,
  179.         [in] IVMRSurfaceAllocator* lpIVRMSurfaceAllocator
  180.         );
  181.  
  182.     HRESULT SetDDrawDevice(
  183.         [in] LPDIRECTDRAW7 lpDDrawDevice,
  184.         [in] HMONITOR hMonitor
  185.         );
  186.  
  187.     HRESULT ChangeDDrawDevice(
  188.         [in] LPDIRECTDRAW7 lpDDrawDevice,
  189.         [in] HMONITOR hMonitor
  190.         );
  191.  
  192.     HRESULT RestoreDDrawSurfaces();
  193.  
  194.     HRESULT NotifyEvent(
  195.         [in] LONG EventCode,
  196.         [in] LONG_PTR Param1,
  197.         [in] LONG_PTR Param2
  198.         );
  199.  
  200.     HRESULT SetBorderColor(
  201.         [in] COLORREF clrBorder
  202.         );
  203. };
  204.  
  205.  
  206.  
  207. ///////////////////////////////////////////////////////////////////////////////
  208. //
  209. // Application control and configuration interfaces
  210. //
  211. ///////////////////////////////////////////////////////////////////////////////
  212.  
  213.  
  214. //=====================================================================
  215. //
  216. // IVMRWindowlessControl
  217. //
  218. //=====================================================================
  219. typedef enum {
  220.     VMR_ARMODE_NONE,
  221.     VMR_ARMODE_LETTER_BOX
  222. } VMR_ASPECT_RATIO_MODE;
  223.  
  224. [
  225.     local,
  226.     object,
  227.     local,
  228.     uuid(0eb1088c-4dcd-46f0-878f-39dae86a51b7),
  229.     helpstring("IVMRWindowlessControl Interface"),
  230.     pointer_default(unique)
  231. ]
  232. interface IVMRWindowlessControl : IUnknown
  233. {
  234.     //
  235.     //////////////////////////////////////////////////////////
  236.     // Video size and position information
  237.     //////////////////////////////////////////////////////////
  238.     //
  239.     HRESULT GetNativeVideoSize(
  240.         [out] LONG* lpWidth,
  241.         [out] LONG* lpHeight,
  242.         [out] LONG* lpARWidth,
  243.         [out] LONG* lpARHeight
  244.         );
  245.  
  246.     HRESULT GetMinIdealVideoSize(
  247.         [out] LONG* lpWidth,
  248.         [out] LONG* lpHeight
  249.         );
  250.  
  251.     HRESULT GetMaxIdealVideoSize(
  252.         [out] LONG* lpWidth,
  253.         [out] LONG* lpHeight
  254.         );
  255.  
  256.     HRESULT SetVideoPosition(
  257.         [in] const LPRECT lpSRCRect,
  258.         [in] const LPRECT lpDSTRect
  259.         );
  260.  
  261.     HRESULT GetVideoPosition(
  262.         [out] LPRECT lpSRCRect,
  263.         [out] LPRECT lpDSTRect
  264.         );
  265.  
  266.     HRESULT GetAspectRatioMode(
  267.         [out] DWORD* lpAspectRatioMode
  268.         );
  269.  
  270.     HRESULT SetAspectRatioMode(
  271.         [in] DWORD AspectRatioMode
  272.         );
  273.  
  274.     //
  275.     //////////////////////////////////////////////////////////
  276.     // Display and clipping management
  277.     //////////////////////////////////////////////////////////
  278.     //
  279.     HRESULT SetVideoClippingWindow(
  280.         [in] HWND hwnd
  281.         );
  282.  
  283.     HRESULT RepaintVideo(
  284.         [in] HWND hwnd,
  285.         [in] HDC hdc
  286.         );
  287.  
  288.     HRESULT DisplayModeChanged();
  289.  
  290.  
  291.     //
  292.     //////////////////////////////////////////////////////////
  293.     // GetCurrentImage
  294.     //
  295.     // Returns the current image being displayed.  This images
  296.     // is returned in the form of packed Windows DIB.
  297.     //
  298.     // GetCurrentImage can be called at any time, also
  299.     // the caller is responsible for free the returned memory
  300.     // by calling CoTaskMemFree.
  301.     //
  302.     // Excessive use of this function will degrade video
  303.     // playback performed.
  304.     //////////////////////////////////////////////////////////
  305.     //
  306.     HRESULT GetCurrentImage(
  307.         [out] BYTE** lpDib
  308.         );
  309.  
  310.     //
  311.     //////////////////////////////////////////////////////////
  312.     // Border Color control
  313.     //
  314.     // The border color is color used to fill any area of the
  315.     // the destination rectangle that does not contain video.
  316.     // It is typically used in two instances.  When the video
  317.     // straddles two monitors and when the VMR is trying
  318.     // to maintain the aspect ratio of the movies by letter
  319.     // boxing the video to fit within the specified destination
  320.     // rectangle. See SetAspectRatioMode above.
  321.     //////////////////////////////////////////////////////////
  322.     //
  323.     HRESULT SetBorderColor(
  324.         [in] COLORREF Clr
  325.         );
  326.  
  327.     HRESULT GetBorderColor(
  328.         [out] COLORREF* lpClr
  329.         );
  330.  
  331.     //
  332.     //////////////////////////////////////////////////////////
  333.     // Color key control only meaningful when the VMR is using
  334.     // and overlay
  335.     //////////////////////////////////////////////////////////
  336.     //
  337.     HRESULT SetColorKey(
  338.         [in] COLORREF Clr
  339.         );
  340.  
  341.     HRESULT GetColorKey(
  342.         [out] COLORREF* lpClr
  343.         );
  344. };
  345.  
  346.  
  347.  
  348. //=====================================================================
  349. //
  350. // IVMRMixerControl
  351. //
  352. //=====================================================================
  353.  
  354. typedef enum {
  355.     MixerPref_NoDecimation                 = 0x00000001, // No decimation - full size
  356.     MixerPref_DecimateOutput               = 0x00000002, // decimate output by 2 in x & y
  357.     MixerPref_DecimateMask                 = 0x0000000F,
  358.  
  359.     MixerPref_BiLinearFiltering            = 0x00000010, // use bi-linear filtering
  360.     MixerPref_PointFiltering               = 0x00000020, // use point filtering
  361.     MixerPref_FilteringMask                = 0x000000F0, // OR of all above flags
  362.  
  363.     MixerPref_RenderTargetRGB              = 0x00000100,
  364.     MixerPref_RenderTargetYUV420           = 0x00000200,
  365.     MixerPref_RenderTargetYUV422           = 0x00000400,
  366.     MixerPref_RenderTargetYUV444           = 0x00000800, // AYUV render target.
  367.     MixerPref_RenderTargetReserved         = 0x0000F000, // 4 bits reserved for future use.
  368.     MixerPref_RenderTargetMask             = 0x0000FF00, // OR of all above flags
  369. } VMRMixerPrefs;
  370.  
  371. //
  372. //  Normalized relative rectangle
  373. //  Coordinate ranges: x=[0...1) y=[0...1)
  374. //  Where the output window goes from 0,0 (closed inclusive lower bound)
  375. //  to 1,1 (open exclusive upper bound)
  376. //
  377. typedef struct _NORMALIZEDRECT
  378. {
  379.     float left;
  380.     float top;
  381.     float right;
  382.     float bottom;
  383. } NORMALIZEDRECT, *PNORMALIZEDRECT;
  384.  
  385. [
  386.     local,
  387.     object,
  388.     local,
  389.     uuid(1c1a17b0-bed0-415d-974b-dc6696131599),
  390.     helpstring("IVMRMixerControl Interface"),
  391.     pointer_default(unique)
  392. ]
  393. interface IVMRMixerControl : IUnknown
  394. {
  395.     HRESULT SetAlpha(
  396.         [in] DWORD dwStreamID,
  397.         [in] float Alpha // Source alpha premultication factor (global alpha for source)
  398.         );
  399.  
  400.     HRESULT GetAlpha(
  401.         [in] DWORD dwStreamID,
  402.         [out] float* pAlpha
  403.         );
  404.  
  405.     HRESULT SetZOrder(
  406.         [in] DWORD dwStreamID,
  407.         [in] DWORD dwZ
  408.         );
  409.  
  410.     HRESULT GetZOrder(
  411.         [in] DWORD dwStreamID,
  412.         [out] DWORD* pZ
  413.         );
  414.  
  415.     HRESULT SetOutputRect(
  416.         [in] DWORD dwStreamID,
  417.         [in] const NORMALIZEDRECT *pRect
  418.         );
  419.  
  420.     HRESULT GetOutputRect(
  421.         [in] DWORD dwStreamID,
  422.         [out] NORMALIZEDRECT *pRect
  423.         );
  424.  
  425.     HRESULT SetBackgroundClr(
  426.         [in] COLORREF ClrBkg
  427.         );
  428.  
  429.     HRESULT GetBackgroundClr(
  430.         [in] COLORREF* lpClrBkg
  431.         );
  432.  
  433.     HRESULT SetMixingPrefs(
  434.         [in] DWORD dwMixerPrefs  // a combination of VMRMixingPrefFlags
  435.         );
  436.  
  437.     HRESULT GetMixingPrefs(
  438.         [out] DWORD* pdwMixerPrefs
  439.         );
  440. };
  441.  
  442.  
  443. ///////////////////////////////////////////////////////////////////////////////
  444. //
  445. // VMR Multimon configuration interface
  446. //
  447. ///////////////////////////////////////////////////////////////////////////////
  448. typedef struct tagVMRGUID {
  449.     GUID*       pGUID; // is NULL if the default DDraw device
  450.     GUID        GUID;   // otherwise points to this GUID
  451. } VMRGUID;
  452.  
  453. #define VMRDEVICENAMELEN 32
  454. #define VMRDEVICEDESCRIPTIONLEN  256
  455.  
  456. typedef struct tagVMRMONITORINFO {
  457.     VMRGUID     guid;
  458.     RECT        rcMonitor;
  459.     HMONITOR    hMon;
  460.     DWORD       dwFlags;    // described in MONITORINFOEX, currently only MONITORINFOF_PRIMARY
  461.     wchar_t     szDevice[VMRDEVICENAMELEN];
  462.     wchar_t     szDescription[VMRDEVICEDESCRIPTIONLEN];
  463.     LARGE_INTEGER liDriverVersion;
  464.     DWORD       dwVendorId;
  465.     DWORD       dwDeviceId;
  466.     DWORD       dwSubSysId;
  467.     DWORD       dwRevision;
  468.     // find out the DDCAPS using DDrawCreate on the monitor GUID
  469. } VMRMONITORINFO;
  470.  
  471. [
  472.     object,
  473.     local,
  474.     uuid(9cf0b1b6-fbaa-4b7f-88cf-cf1f130a0dce),
  475.     helpstring("IVMRMonitorConfig Interface"),
  476.     pointer_default(unique)
  477. ]
  478. interface IVMRMonitorConfig : IUnknown
  479. {
  480.     // Use this method on a Multi-Monitor system to specify to the
  481.     // mixer filter which Direct Draw driver should be used when connecting
  482.     // to an upstream decoder filter.
  483.     //
  484.     HRESULT SetMonitor(
  485.         [in] const VMRGUID *pGUID
  486.         );
  487.  
  488.     // Use this method to determine the direct draw object that will be used when
  489.     // connecting the  mixer filter to an upstream decoder filter.
  490.     //
  491.     HRESULT GetMonitor(
  492.         [out] VMRGUID *pGUID
  493.         );
  494.  
  495.     // Use this method on a multi-monitor system to specify to the
  496.     //  mixer filter the default Direct Draw device to use when
  497.     // connecting to an upstream filter.  The default direct draw device
  498.     // can be overriden for a particular connection by SetMonitor method
  499.     // described above.
  500.     //
  501.     HRESULT SetDefaultMonitor(
  502.         [in] const VMRGUID *pGUID
  503.         );
  504.  
  505.     // Use this method on a multi-monitor system to determine which
  506.     // is the default direct draw device the overlay mixer filter
  507.     // will  use when connecting to an upstream filter.
  508.     //
  509.     HRESULT GetDefaultMonitor(
  510.         [out] VMRGUID *pGUID
  511.         );
  512.  
  513.     // Use this method to get a list of Direct Draw device GUIDs and thier
  514.     // associated monitor information that the mixer can use when
  515.     // connecting to an upstream decoder filter.  Passing down a NULL pInfo
  516.     // parameter allows the app to determine the required array size (returned
  517.     // in pdwNumDevices).  Otherwise, dwNumDevices returns the actual
  518.     // number of devices retrieved.
  519.     //
  520.     HRESULT GetAvailableMonitors(
  521.         [out, size_is(dwMaxInfoArraySize)] VMRMONITORINFO* pInfo,
  522.         [in] DWORD dwMaxInfoArraySize, // in array members
  523.         [out] DWORD* pdwNumDevices // actual number of devices retrieved
  524.         );
  525. };
  526.  
  527.  
  528.  
  529.  
  530. ///////////////////////////////////////////////////////////////////////////////
  531. //
  532. // VMR Filter configuration interfaces
  533. //
  534. ///////////////////////////////////////////////////////////////////////////////
  535.  
  536.  
  537. typedef enum {
  538.     RenderPrefs_ForceOffscreen               = 0x00000001,
  539.     RenderPrefs_ForceOverlays                = 0x00000002, // fail if no overlays
  540.     RenderPrefs_AllowOverlays                = 0x00000000, // overlay used by default
  541.     RenderPrefs_AllowOffscreen               = 0x00000000, // offscreen used if no overlay
  542.     RenderPrefs_DoNotRenderColorKeyAndBorder = 0x00000008, // app paints color keys
  543.     RenderPrefs_RestrictToInitialMonitor     = 0x00000010, // output only to initial monitor
  544.     RenderPrefs_PreferAGPMemWhenMixing       = 0x00000020, // try agp mem when allocating textures
  545.  
  546.     RenderPrefs_Mask                         = 0x0000003f, // OR of all above flags
  547. } VMRRenderPrefs;
  548.  
  549. typedef enum {
  550.     VMRMode_Windowed                         = 0x00000001,
  551.     VMRMode_Windowless                       = 0x00000002,
  552.     VMRMode_Renderless                       = 0x00000004,
  553.  
  554.     // not a valid value to pass to SetRenderMode
  555.     VMRMode_Mask                             = 0x00000007, // OR of all above flags
  556. } VMRMode;
  557.  
  558. enum {
  559.         MAX_NUMBER_OF_STREAMS = 16
  560. };
  561.  
  562. [
  563.     object,
  564.     local,
  565.     uuid(9e5530c5-7034-48b4-bb46-0b8a6efc8e36),
  566.     helpstring("IVMRFilterConfig Interface"),
  567.     pointer_default(unique)
  568. ]
  569. interface IVMRFilterConfig : IUnknown
  570. {
  571.     HRESULT SetImageCompositor(
  572.         [in] IVMRImageCompositor* lpVMRImgCompositor
  573.         );
  574.  
  575.     HRESULT SetNumberOfStreams(
  576.         [in] DWORD dwMaxStreams
  577.         );
  578.  
  579.     HRESULT GetNumberOfStreams(
  580.         [out] DWORD* pdwMaxStreams
  581.         );
  582.  
  583.     HRESULT SetRenderingPrefs(
  584.         [in] DWORD dwRenderFlags  // a combination of VMRRenderingPrefFlags
  585.         );
  586.  
  587.     HRESULT GetRenderingPrefs(
  588.         [out] DWORD* pdwRenderFlags
  589.         );
  590.  
  591.     HRESULT SetRenderingMode(
  592.         [in] DWORD Mode  // a combination of VMRMode
  593.         );
  594.  
  595.     HRESULT GetRenderingMode(
  596.         [out] DWORD* pMode
  597.         );
  598. }
  599.  
  600.  
  601.  
  602. //=====================================================================
  603. //
  604. // IVMRMixerBitmap
  605. //
  606. //=====================================================================
  607. typedef struct _VMRALPHABITMAP
  608. {
  609.     DWORD                   dwFlags;    // flags word
  610.     HDC                     hdc;        // DC for the bitmap to copy
  611.     LPDIRECTDRAWSURFACE7    pDDS;       // DirectDraw surface to copy
  612.     RECT                    rSrc;       // rectangle to copy from the DC/DDS
  613.     NORMALIZEDRECT          rDest;      // output rectangle in composition space
  614.     FLOAT                   fAlpha;     // opacity of the bitmap
  615.     COLORREF                clrSrcKey;  // src color key
  616. } VMRALPHABITMAP, *PVMRALPHABITMAP;
  617.  
  618. // Disable the alpha bitmap for now
  619. cpp_quote("#define VMRBITMAP_DISABLE            0x00000001")
  620.  
  621. // Take the bitmap from the HDC rather than the DirectDraw surface
  622. cpp_quote("#define VMRBITMAP_HDC                0x00000002")
  623.  
  624. // Take the entire DDraw surface - rSrc is ignored
  625. cpp_quote("#define VMRBITMAP_ENTIREDDS          0x00000004")
  626.  
  627. // Indicates that the clrTrans value is valid and should be
  628. // used when blending
  629. cpp_quote("#define VMRBITMAP_SRCCOLORKEY        0x00000008")
  630.  
  631. // Indicates that the rSrc rectangle is valid and specifies a
  632. // sub-rectangle of the of original app image to be blended.
  633. // Use of this parameter enables "Image Strips"
  634. cpp_quote("#define VMRBITMAP_SRCRECT            0x00000010")
  635.  
  636. [
  637.     object,
  638.     local,
  639.     uuid(1E673275-0257-40aa-AF20-7C608D4A0428),
  640.     helpstring("IVMRMixerBitmap Interface"),
  641.     pointer_default(unique)
  642. ]
  643. interface IVMRMixerBitmap : IUnknown
  644. {
  645.     // Set bitmap, location to blend it, and blending value
  646.     HRESULT SetAlphaBitmap(
  647.         [in] const VMRALPHABITMAP *pBmpParms
  648.         );
  649.  
  650.     // Change bitmap location, size and blending value,
  651.     // graph must be running for change to take effect.
  652.     HRESULT UpdateAlphaBitmapParameters(
  653.         [in] PVMRALPHABITMAP pBmpParms
  654.         );
  655.  
  656.     // Get bitmap, location to blend it, and blending value
  657.     HRESULT GetAlphaBitmapParameters(
  658.         [out] PVMRALPHABITMAP pBmpParms
  659.         );
  660. };
  661.  
  662.  
  663.  
  664.  
  665.  
  666. //=====================================================================
  667. //
  668. // IVMRImageCompositor
  669. //
  670. //=====================================================================
  671.  
  672. typedef struct _VMRVIDEOSTREAMINFO {
  673.     LPDIRECTDRAWSURFACE7        pddsVideoSurface;
  674.     DWORD                       dwWidth, dwHeight;
  675.     DWORD                       dwStrmID;
  676.     FLOAT                       fAlpha;
  677.     DDCOLORKEY                  ddClrKey;
  678.     NORMALIZEDRECT              rNormal;
  679. } VMRVIDEOSTREAMINFO;
  680. [
  681.     local,
  682.     object,
  683.     local,
  684.     uuid(7a4fb5af-479f-4074-bb40-ce6722e43c82),
  685.     helpstring("IVMRImageCompositor Interface"),
  686.     pointer_default(unique)
  687. ]
  688. interface IVMRImageCompositor : IUnknown
  689. {
  690.     HRESULT InitCompositionTarget(
  691.         [in] IUnknown* pD3DDevice,
  692.         [in] LPDIRECTDRAWSURFACE7 pddsRenderTarget
  693.         );
  694.  
  695.     HRESULT TermCompositionTarget(
  696.         [in] IUnknown* pD3DDevice,
  697.         [in] LPDIRECTDRAWSURFACE7 pddsRenderTarget
  698.         );
  699.  
  700.     HRESULT SetStreamMediaType(
  701.         [in] DWORD dwStrmID,
  702.         [in] AM_MEDIA_TYPE* pmt,
  703.         [in] BOOL fTexture
  704.         );
  705.  
  706.     HRESULT CompositeImage(
  707.         [in] IUnknown* pD3DDevice,
  708.         [in] LPDIRECTDRAWSURFACE7 pddsRenderTarget,
  709.         [in] AM_MEDIA_TYPE* pmtRenderTarget,
  710.         [in] REFERENCE_TIME rtStart,
  711.         [in] REFERENCE_TIME rtEnd,
  712.         [in] DWORD dwClrBkGnd,
  713.         [in] VMRVIDEOSTREAMINFO* pVideoStreamInfo,
  714.         [in] UINT cStreams
  715.         );
  716. };
  717.  
  718.  
  719.  
  720. //=====================================================================
  721. //
  722. // IVMRVideoStreamControl
  723. //
  724. //=====================================================================
  725. [
  726.     object,
  727.     local,
  728.     uuid(058d1f11-2a54-4bef-bd54-df706626b727),
  729.     helpstring("IVMRMixerStreamConfig Interface"),
  730.     pointer_default(unique)
  731. ]
  732. interface IVMRVideoStreamControl: IUnknown
  733. {
  734.     HRESULT SetColorKey(
  735.         [in] LPDDCOLORKEY lpClrKey // Source color key, set to 0xFFFFFFFF to disable
  736.         );
  737.  
  738.     HRESULT GetColorKey(
  739.         [out] LPDDCOLORKEY lpClrKey
  740.         );
  741.  
  742.  
  743.     HRESULT SetStreamActiveState(
  744.         [in] BOOL fActive
  745.         );
  746.  
  747.     HRESULT GetStreamActiveState(
  748.         [out] BOOL* lpfActive
  749.         );
  750. };
  751.  
  752.  
  753.  
  754. //=====================================================================
  755. //
  756. // IVMRSurface
  757. //
  758. //=====================================================================
  759. [
  760.     local,
  761.     object,
  762.     local,
  763.     uuid(a9849bbe-9ec8-4263-b764-62730f0d15d0),
  764.     helpstring("IVMRSurface Interface"),
  765.     pointer_default(unique)
  766. ]
  767. interface IVMRSurface : IUnknown
  768. {
  769.     HRESULT IsSurfaceLocked();
  770.  
  771.     HRESULT LockSurface(
  772.         [out] BYTE** lpSurface
  773.         );
  774.  
  775.     HRESULT UnlockSurface();
  776.  
  777.     HRESULT GetSurface(
  778.         [out] LPDIRECTDRAWSURFACE7 *lplpSurface
  779.         );
  780. };
  781.  
  782.  
  783.  
  784. //=====================================================================
  785. //
  786. // IID_IVMRImagePresenterConfig - this interface allows applications
  787. // to configure the default Microsoft provided allocator-presenter
  788. // inorder to simplify the implementation of their own
  789. // allocator-presenter plug-in.
  790. //
  791. //=====================================================================
  792. [
  793.     local,
  794.     object,
  795.     local,
  796.     uuid(9f3a1c85-8555-49ba-935f-be5b5b29d178),
  797.     helpstring("IVMRImagePresenterConfig Interface"),
  798.     pointer_default(unique)
  799. ]
  800.  
  801. interface IVMRImagePresenterConfig : IUnknown
  802. {
  803.  
  804.     HRESULT SetRenderingPrefs(
  805.         [in] DWORD dwRenderFlags   // see VMRRenderPrefs for valid flags
  806.         );
  807.  
  808.     HRESULT GetRenderingPrefs(
  809.         [out] DWORD* dwRenderFlags // see VMRRenderPrefs for valid flags
  810.         );
  811.  
  812. }
  813.  
  814. //=====================================================================
  815. //
  816. // IID_IVMRImagePresenterExclModeConfig - this interface allows applications
  817. // to configure the DDraw exclusive mode allocator-presenter.  This
  818. // interface extends the IVMRImagePresenterConfig interface defined
  819. // above and is only implemented by the CLSID_AllocPresenterDDXclMode
  820. // allocator-presenter object.
  821. //
  822. //=====================================================================
  823. [
  824.     local,
  825.     object,
  826.     local,
  827.     uuid(e6f7ce40-4673-44f1-8f77-5499d68cb4ea),
  828.     helpstring("IVMRImagePresenterExclModeConfig Interface"),
  829.     pointer_default(unique)
  830. ]
  831.  
  832. interface IVMRImagePresenterExclModeConfig : IVMRImagePresenterConfig
  833. {
  834.     HRESULT SetXlcModeDDObjAndPrimarySurface(
  835.         [in] LPDIRECTDRAW7 lpDDObj,
  836.         [in] LPDIRECTDRAWSURFACE7 lpPrimarySurf
  837.         );
  838.  
  839.     HRESULT GetXlcModeDDObjAndPrimarySurface(
  840.         [out] LPDIRECTDRAW7* lpDDObj,
  841.         [out] LPDIRECTDRAWSURFACE7* lpPrimarySurf
  842.         );
  843. }
  844.  
  845.  
  846. //=====================================================================
  847. //
  848. // IVPManager
  849. //
  850. //=====================================================================
  851. [
  852.     local,
  853.     object,
  854.     local,
  855.     uuid(aac18c18-e186-46d2-825d-a1f8dc8e395a),
  856.     helpstring("IVPManager Interface"),
  857.     pointer_default(unique)
  858. ]
  859. interface IVPManager : IUnknown
  860. {
  861.     // Use this method on a Multi-Monitor system to specify to the
  862.     // video port manager filter which videoport index is used
  863.     // to an upstream decoder filter.
  864.     //
  865.     HRESULT SetVideoPortIndex(
  866.         [in] DWORD dwVideoPortIndex    // the video port number that this is connected to
  867.         );
  868.  
  869.     // This method returns the current video port index being used by the VPM.
  870.     //
  871.     HRESULT GetVideoPortIndex(
  872.         [out] DWORD* pdwVideoPortIndex // the video port number that this is connected to
  873.         );
  874. };
  875.  
  876.